#!/usr/bin/python
# -*- coding: UTF-8 -*-

class IndusBean(object):
    def __init__(self,dict):
        self.__name=dict["name"]
        self.__des=dict["des"]
        self.__sample=dict["sample"]
        self.__g=dict["g"]

    #获取行业名称
    def get_name(self):
        return self.__name
    #设置行业名称
    def set_name(self,name):
        self.__name=name
    #设置行业逻辑
    def set_des(self,des):
        self.__des=des
    #行业逻辑
    def get_des(self):
        return self.__des
    #行业自选股
    def set_smaple(self):
        return self.__sample
    #行业只择股
    def get_sample(self):
        return self.__sample
    #设置行业关注度
    def set_g(self,g):
        self.__g=g
    #关注度
    def get_g(self):
        return self.__g

    def to_json(self):
        return {
            "name":self.get_name(),
            "des":self.get_des(),
            "sample":self.get_sample(),
            "g":self.get_g()
        }

    @staticmethod
    def object_hook(d):
        return IndusBean(d)
